/**
 * Created by zhaomi on 16/5/19.
 */
var conn=require('../conf/mysql')
module.exports={
    insertLesson:function(course_table_id,begin_time,cb){
        var options={
            sql: 'insert into classroom_lesson(course_table_id,begin_time) values(?,?)',
            params: [course_table_id,begin_time],
            handle: function(results){
                cb(results)
            }
        }
        conn.execQuery(options)
    },
    updateLesson:function(lessonId,call_name_time,cb){
        var options={
            sql: 'update classroom_lesson set call_name_time=? where id=?',
            params: [call_name_time,lessonId],
            handle: function(results){
                cb(results)
            }
        }
        conn.execQuery(options)
    },
    miss_class:function(params,cb){
        var options={
            sql: 'insert into miss_class(lesson_id,stu_id,call_name_time,emoji) values ?',
            params: [params],
            handle: function(results){
                cb(results)
            }
        }
        conn.execQuery(options)
    },
    send_topic:function (lessonId,topicId,tea_id,emoji,sendTime,cb) {
        var options={
            sql: 'insert into send_topic(lesson_id,topic_id,tea_id,emoji,send_time) values (?,?,?,?,?)',
            params: [lessonId,topicId,tea_id,emoji,sendTime],
            handle: function(results){
                cb(results)
            }
        }
        conn.execQuery(options)
    }
}